{% extends "forum/frame.html" %}
{% load i18n %} 
{% load string %}
{% load ytutil %}

{% block description %}
  <meta name="description" content="{% for board in expanded_boards %}{{ board.title|escape }}, {% endfor %}{% for board in boards %}{{ board.title|escape }}, {% endfor %}">
{% endblock %}

{% block content %}

    {% for board in expanded_boards %}
    <div class="expanded_board">
    <a class="forum_link" href="{% url ytcommunity.forum.view.board.display name=board.get_board_key %}">{{ board.title|escape }}</a>
    </div>
    <table class="forum" cellspacing="1">
      <thead>
        <tr>
          <td class="forum_title" style="border-left: 1px solid white;width:70%;">{% trans 'Board' %}</td>
          <td class="forum_title" style="width: 15%;">{% trans 'Post Number' %}</td>
          <td class="forum_title" style="width: 15%; border-right: 1px solid white;">{% trans 'Latest' %}</td>
        </tr>
      </thead>
      <tbody>
      
      {% for sub_board in board.get_sub_boards %}
      <tr>
      <td class="forum_body">
        <a href="{% url ytcommunity.forum.view.board.display name=sub_board.get_board_key %}">{{ sub_board.title|escape }}</a>    
      </td>
      <td class="forum_body_center">{{ sub_board.number }}</td>
      <td class="forum_body_center">
        {{ sub_board.date|timedelta|date:"Y-m-d H:i" }}
      </td>
      </tr>
      {% endfor %}
    
      </tbody>
      
    </table>
    {% endfor %}


    {% if boards %}
    <table class="forum" cellspacing="1">
      <thead>
        <tr>
          <td class="forum_title" style="border-left: 1px solid white;width:70%;">{% trans 'Board' %}</td>
          <td class="forum_title" style="width: 15%;">{% trans 'Post Number' %}</td>
          <td class="forum_title" style="width: 15%; border-right: 1px solid white;">{% trans 'Latest' %}</td>
        </tr>
      </thead>
      <tbody>
      
      {% for board in boards %}
      <tr>
      <td class="forum_body">
        <a href="{% url ytcommunity.forum.view.board.display name=board.get_board_key %}">{{ board.title|escape }}</a>    
      </td>
      <td class="forum_body_center">{{ board.number }}</td>
      <td class="forum_body_center">
        {{ board.date|timedelta|date:"Y-m-d H:i" }}
      </td>
      </tr>
      {% endfor %}
    
      </tbody>
      
    </table>
    {% endif %}
  
  {% include "forum/div_pagination.html" %}
  
{% endblock %}
